﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using System.Windows.Media.Imaging;

namespace WasaWasa
{
    class UserClass
    {
        [JsonProperty("login_id")]
        public string _LoginId { get; set; }
        [JsonProperty("screen_name")]
        public string _ScreenName { get; set; }
        [JsonProperty("nick")]
        public string _Nick { get; set; }
        [JsonProperty("name")]
        public string _Name { get; set; }

        public string LoginId
        {
            get { return _LoginId != null ? _LoginId : _ScreenName; }
        }

        public string Nick
        {
            get { return _Nick != null ? _Nick : _Name; }
        }

        public string UserLink
        {
            get { return LoginId != null ? "http://wassr.jp/user/" + LoginId : null; }
        }

        public BitmapImage ProfileImage
        {
            get { return UserImageCache.Default.GetProfilePicture(LoginId); }
        }
        //public string ProfileImageUrl
        //{
        //    get { return new UriBuilder(Uri.UriSchemeHttp, MainWindow.ApiPictureHost, MainWindow.ApiPort, "/user/" + (ScreenName != null ? ScreenName : LoginId) + "/profile_img.png.64").ToString(); }
        //}
    }
}
